/*
 * @Description: 数组
 * @Author: rendc
 * @Date: 2025-07-23 09:50:44
 * @LastEditors: rendc
 * @LastEditTime: 2025-07-23 10:13:04
 */

public class Test02 {

  public static void main(String[] args) {
    int a = 10;
    int b = a;
    // a ?
    // b ?
    System.out.println("a:" + a); // 10
    System.out.println("b:" + b); // 10
    a = 20;
    // a ?
    // b ?
    System.out.println("a:" + a); // 20
    System.out.println("b:" + b); // 10
    int[] arr1 = { 1, 2, 3 };
    int[] arr2 = arr1;
    System.out.println("arr1[0]:" + arr1[0]); // 1
    System.out.println("arr2[0]:" + arr2[0]); // 1
    arr1[0] = 10;
    System.out.println("arr1[0]:" + arr1[0]); // 10
    System.out.println("arr2[0]:" + arr2[0]); // 1?
    // 数组遍历
    // for (int i = 0; i <= 10; i++) {
    // System.out.println(arr1[i]);
    // }
    int[] arr;
    arr = new int[] { 1, 2, 3 };
    // int[] arr9;
    // arr9={1,2,3};
    // int[] arr8 = new int[3] { 1, 2, 3 };

    // int[] arr7 = new int[0];
    // int[] arr7;
    // arr7 = new int[0];
    // int[] arr7 = new int[-1]; // 运行时错误
    // int[] arr7 = new int[10];
    // int[] arr7 = new double[10];
    // double[] arr7 = new int[10];
    // System.out.println("arr7:" + arr7);
  }
}